/**
* @description : 监管对象查询首页
* @descriptionDetail : 监管对象查询首页
* @copyright : 浙江烟草
* @author : mc
* @create : 2022-12-05 15:36:03
*/
<template>
	<view class="page">
		<!-- #ifdef H5-ONLY -->
		<theme-navbar :is-white="false" :title="navTitle" :custom-back="goBack" style="z-index: 99999">
		</theme-navbar>
		<!-- #endif -->
		<view class="content u-page">
			<!-- 内容区 -->
			<u-image class="head-img" :width="getImgWidth()" src="/static/common/banner_op.png" mode="widthFix"></u-image>
			<view class="grid-lay">
				<u-grid :col="3" :border="false">
					<u-grid-item :index="index" v-for="(item,index) in list" :key="item.key" @click="gridClick">
						<u-image :src="item.iconPath" :width="120" mode="aspectFit" :height="120"></u-image>
						<view class="grid-text">
							{{ item.text }}
						</view>
					</u-grid-item>
				</u-grid>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {

		},
		data() {
			return {
				list: [{
						iconPath: "../../static/query/rq_icon1.png",
						text: '零售户走访',
						key: 0,
						url: 'pages/retailer/retailerList/retailerList?isInterview=' + 1,
					},
					{
						iconPath: "../../static/query/rq_icon2.png",
						text: '无证户走访',
						key: 1,
						url: 'pages/query/nolicence/nolicence?isInterview=' + 1,
					},
				],
			};
		},
		// 页面加载成功后也要设置一次，用于处理本页面刷新后失效问题
		mounted() {

		},
		methods: {
			gridClick(index) {
				console.log(index)
				if (this.list[index].url) {
					this.setRouteParam(this.list[index].text);
					this.$u.route(this.list[index].url);
				}
			},
			getImgWidth() {
				return (this.$u.sys().windowWidth - uni.upx2px(32)) + 'px';
			},
			updateBackState(param) {
				console.log(param);
			},
		},
	};
</script>

<style lang="scss" scoped>
	.head-img {
		width: 100%;
		padding: 16rpx 16rpx;
		margin: 0 auto;
	}

	.grid-lay {
		padding: 0 32rpx;
	}

	.grid-text {
		color: $u-main-color;
		margin-top: 24rpx;
		font-size: 30rpx;
	}
</style>